package com.wulis.common.model.entity;

import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 树形结构父级实体类
 * 
 * @author WuliBao
 * @date 2020-05-22
 */
@Data
@Accessors(chain = true)
public class Node<T extends Node<T>> {
    
    @ApiModelProperty("节点ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    
    @ApiModelProperty("父节点ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;
    
    @ApiModelProperty("子节点")
    private List<T> nodes;
}
